USE AAL

----------update----------------------
ALTER TABLE Storage ADD CONSTRAINT FK_Storage_Warehouse  
FOREIGN KEY (WarehouseID) REFERENCES Warehouse (ID) 

ALTER TABLE Storage ADD CONSTRAINT FK_Storage_Product  
FOREIGN KEY (ProductID) REFERENCES Product (ID)

ALTER TABLE OrderRequest ADD CONSTRAINT FK_OrderRequest_Account  
FOREIGN KEY (AccountID) REFERENCES Account (ID)

ALTER TABLE OrderDetails ADD CONSTRAINT FK_OrderDetails_OrderRequest  
FOREIGN KEY (OrderID) REFERENCES OrderRequest (ID)

ALTER TABLE BillDetails ADD CONSTRAINT FK_BillDetails_ImportExportBills  
FOREIGN KEY (BillID) REFERENCES ImportExportBills (ID)  

/* Account Table */
INSERT INTO Account VALUES ('giangnn', 'giangng', NULL, 2)
INSERT INTO Account VALUES ('hienln', 'hienln', NULL, 3)
INSERT INTO Account VALUES ('sangvt', 'sangvt', NULL, 4)
INSERT INTO Account VALUES ('admin', 'admin', NULL, 5)

/* AccountInformation Table */
INSERT INTO AccountInformation VALUES (13, 'Giang', 'Nguyen', 'billgates_giang@yahoo.com', 'Vinh Long', '01648256050', NULL, '1987-10-29')
INSERT INTO AccountInformation VALUES (14, 'Hien', 'Le', 'ngochien@yahoo.com', 'Ho Chi Minh', '0988032188', NULL, '1987-11-20')
INSERT INTO AccountInformation VALUES (15, 'Sang', 'Vo', 'thanhsang@yahoo.com', 'Soc Trang', '0988032187', NULL, '1987-05-14')
INSERT INTO AccountInformation VALUES (16, 'Toan', 'Tran', 'toantrt@gmail.com', 'Ho Chi Minh', '08123123123', NULL, '1987-03-11')

/* Factory Table */
INSERT INTO Factory VALUES ('Factory 1', '0988032188', 'Factory 1', 1)
INSERT INTO Factory VALUES ('Factory 2', '1234567897', 'Factory 2', 1)
INSERT INTO Factory VALUES ('Factory 3', '1234567895', 'Factory 3', 1)
INSERT INTO Factory VALUES ('Factory 4', '1234567892', 'Factory 4', 1)

/* Warehouse Table */
INSERT INTO Warehouse VALUES ('Warehouse 1', 'Ho Chi Minh', '1234567893', NULL, NULL)
INSERT INTO Warehouse VALUES ('Warehouse 2', 'Can Tho', '1234567891', NULL, NULL)
INSERT INTO Warehouse VALUES ('Warehouse 3', 'Da Nang', '1234567890', NULL, NULL)
INSERT INTO Warehouse VALUES ('Warehouse 4', 'Ha Noi', '1234567898', NULL, NULL)

/* Product Table */
INSERT INTO Product VALUES (1, 'Deep Groove Ball Bearing', 'images/Deep_Groove_Ball_Bearing.jpg', 
'Ceramic deep groove ball bearing is available in a wide variety of seal, shield and snap-ring arrangements. 
The bearing ring grooves are circular arcs made slightly larger than the radius of the ball.', 150)
GO

INSERT INTO Product VALUES (1, 'Textile Machine Component', 'images/textile_machine_component.jpg', 
'Materail: Steel, Stainless Steel, Cast Iron,Aluminum,Brass, Copper, Nylon,ABS.', 50)
GO

INSERT INTO Product VALUES (2, 'Valve Forging Machined', 'images/Valve_forging_machined.jpg', 
'Valve components for Siemens customer by brass forging,machining and powder coating.', 250)
GO

INSERT INTO Product VALUES (2, 'Worm Gears For Woodworking Machines', 'images/Worm_gears_for_woodworking_machines.jpg', 
'worm spur gears are suitable for differential speed box, transmission parts,agriculture machines,woodworking machines 2. they are made from Carbon steel, stainless steel, aluminium alloy, bronze or brass with the surface finishing carburizing, hardening and tempering.', 350)
GO

INSERT INTO Product VALUES (2, '21306 Spherical Roller Bearings', 'images/21306_Spherical_Roller_Bearings.jpg', 
'This type of bearing consists of spherical outer race and inner race with two tracks, a cage, and a complement of spherical shaped rollers. Just like double row self aligning ball bearings too are sensitive to misalignment and they can adjust themselves to shaft deflections.Except radial loads.', 45)
GO

INSERT INTO Product VALUES (3, 'Slewing Bearings', 'images/Slewing_Bearings.jpg', 
'Slewing bearings are ball or cylindrical roller bearings that can accommodate axial, radial and moment loads acting either singly or in combination and in any direction. They are not mounted in a housing or on a shaft, but directly to a seating surface.', 75)
GO

INSERT INTO Product VALUES (3, 'DIN check valve', 'images/DIN_check_valve.jpg', 
'Design and Manufacture:BS 1868,ASME B 16.34 and API 6D
Forged steel check valve: API 602
Inspection and Test:API598 or API 6D
End flange dimension:ASME B16.5;AMSE B16.47 series B.', 175)
GO

INSERT INTO Product VALUES (3, 'FM1 Flow Meter', 'images/FM1_flow_meter.jpg', 
'FM1 Flow meter , adopts advanced technology, which can be widely used on different gasoline dispensers. This product has advantages as long using term, high precision, firm structure etc. It can be the best choice of gasoline dispenser component.', 28)
GO

INSERT INTO Product VALUES (3, 'Taper Roller Bearing', 'images/Taper_Roller_Bearing.jpg', 
'Taper roller bearings can endure radial and axial combined load, mainly is radial load. The carrying capacity of bearings is decided by the angle of rollaway nest in outside track, the bigger contact angle, the greater amount of carrying capacity.', 458)
GO

/* Storage Table */
INSERT INTO Storage VALUES (1, 1, 100, 1, 2011-06-25)
INSERT INTO Storage VALUES (2, 1, 100, 1, 2011-06-24)
INSERT INTO Storage VALUES (3, 1, 100, 1, 2011-06-23)
INSERT INTO Storage VALUES (6, 1, 100, 1, 2011-06-22)
INSERT INTO Storage VALUES (7, 2, 100, 2, 2011-06-21)
INSERT INTO Storage VALUES (8, 2, 100, 2, 2011-06-20)
INSERT INTO Storage VALUES (9, 2, 100, 2, 2011-06-19)
INSERT INTO Storage VALUES (10, 2, 100, 2, 2011-06-18)
INSERT INTO Storage VALUES (11, 3, 100, 3, 2011-06-17)
INSERT INTO Storage VALUES (12, 3, 100, 3, 2011-06-16)
INSERT INTO Storage VALUES (13, 3, 100, 3, 2011-06-15)
INSERT INTO Storage VALUES (14, 4, 100, 4, 2011-06-14)
INSERT INTO Storage VALUES (15, 4, 100, 4, 2011-06-13)
INSERT INTO Storage VALUES (16, 4, 100, 4, 2011-06-12)
INSERT INTO Storage VALUES (17, 4, 100, 4, 2011-06-11)


/* OrderRequest Table */
INSERT INTO OrderRequest VALUES (7, '2011-05-19', 'Order Product', 1, 14, '2011-05-25', NULL, '10')
INSERT INTO OrderRequest VALUES (13, '2011-06-22', 'Order Product', 0, 14, '2011-06-29', NULL, '25')
INSERT INTO OrderRequest VALUES (14, '2011-07-12', 'Order Product', 1, 14, '2011-07-19', NULL, '5')

/*  OrderDetails Table */
INSERT INTO OrderDetails VALUES (2, 2, 5, '400', '2000')
INSERT INTO OrderDetails VALUES (3, 1, 10, '400', '4000')
INSERT INTO OrderDetails VALUES (4, 3, 15, '150', '2250')

/* ImportExportBills Table*/
INSERT INTO ImportExportBills VALUES (13, '2011-06-22', NULL, NULL, 15, '2011-06-29', 4000, 5, 3800)
INSERT INTO ImportExportBills VALUES (14, '2011-07-12', NULL, NULL, 15, '2011-07-19', 2250, 3, 157.5)


/* BillDetails Table */
INSERT INTO BillDetails VALUES (1, 2, 5, 400)
INSERT INTO BillDetails VALUES (2, 3, 15, 150)


